home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS18.ADF
/
Progs
/
StarProbe
/
SPMAIN.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-01-27
|
3KB
|
106 lines
/****************************************************************************
*** ***
*** S T A R P R O B E ***
*** ***
****************************************************************************/
/*****
*** This program performs a cursory mathematical analysis of a star's
*** interior.
*****/
/*****
*** Global functions & procedures
*****/
#include "stdio.h"
#include "spproc.h"
/*****
*** Global variables
*****/
#include "spmac.h"
#include "spint.h"
#include "spflt.h"
/****************************************************************************
*** M A I N ***
****************************************************************************/
main()
{
initialize();
set_boundary_conditions();
report_global();
evaluate();
shutdown();
}
/*****
*** B l o c k T r a c e
*****/
FILE *pf;
void block_trace(proc,dir,str,val)
{
if (dir==in) {
level++;
if (level>MAX_LEVELS)
assert_error(-1,(double)level,(double)MAX_LEVELS,0.0,0.0,0.0,0.0,0.0);
proc_stack[level] = proc;
if ((debug > 1) | (debug == 1 && proc_trace[proc]==1))
fprintf(pf,"Enter ** %d ** %s = %g\n",level,str,val);
}
else
if (dir==mid) {
if ((debug > 2) | (debug==1 && proc_trace[proc]==1))
fprintf(pf," ** %d ** %s = %g\n",level,str,val);
}
else
if (dir==out) {
if ((debug > 1) | (debug == 1 && proc_trace[proc]==1))
fprintf(pf,"Exit ** %d ** %s = %g\n",level,str,val);
level--;
}
}
/*****
*** A s s e r t E r r o r
*****/
void assert_error(proc,var,val,m,p,t,l,r)
int proc;
double var,val,m,p,t,l,r;
{
int i;
fprintf(stderr,"########################################################\n");
fprintf(stderr,"### Assertion error in proc %d (%g :: %g)\n",proc,var,val);
fprintf(stderr,"########################################################\n");
fprintf(stderr,"Procedure trace:");
for (i=0;i<=level;i++)
fprintf(stderr," %2d",(proc_stack[i]));
fprintf(stderr,"\n");
fprintf(stderr,"Current parameters:\n");
fprintf(stderr," m = %g\n",m);
fprintf(stderr," p = %g\n",p);
fprintf(stderr," t = %g\n",t);
fprintf(stderr," l = %g\n",l);
fprintf(stderr," r = %g\n",r);
report_results();
fprintf(stderr,"########################################################\n");
exit(1);
}